package org.originit.factory.config;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class DefaultSingletonBeanRegistry implements SingletonBeanRegistry{

    private final Map<String,Object> singletons = new ConcurrentHashMap<>();

    @Override
    public Object getSingleton(String name) {
        return singletons.get(name);
    }

    protected void addSingleton(String name,Object bean) {
        singletons.put(name,bean);
    }
}
